package online.longzipeng.mywebdemo.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @Author: lzp
 * @description: 静态变量配置测试 注意：该方式可能会有未知隐患，只用于学习讨论，不建议用于生产环境
 * @Date: 2023/3/15
 */
@Component
@ConfigurationProperties(prefix = "my-config")
public class MyConfig2 {

	public static String appKey;

	public static String appSecret;

	public void setAppKey(String appKey) {
		MyConfig2.appKey = appKey;
	}

	public void setAppSecret(String appSecret) {
		MyConfig2.appSecret = appSecret;
	}
}
